<include file="Public/head" xmlns="http://www.w3.org/1999/html"/>
<include file="Public/common_header" />
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/css/cashier.css" />
<div class="mian">
    <include file="Public/sidebar" menu="clcwht.jyffddgl"  />
    <div class="mianR">
		<div class="yuyue">
			<ul>
				<li onclick="getList(2);" data-id="0" class="yuCurrent">已支付</li>
				<li onclick="getList(4);" data-id="1">待退款</li>
				<li onclick="getList(5);" id="returned" data-id="2">已退款</li>
			</ul>
		</div>
		<form id="searchFrom">
            <div class="yuSuo clearfix">
                <div id="search1">
                    <input type="text" class="suoDian" id="order_sn" placeholder="请输入订单号" value="">
                    <input type="text" class="suoDian" id="juhe_order_sn" placeholder="请输入第三方订单号" value="">
                    <select id="pay_code" class="tracking_list1">
                    	<option value="">选择支付方式</option>
                    	<option value="ALIPAY">支付宝</option>
                    	<option value="WEIXIN">微信</option>
                    	<option value="LAKALA">拉卡拉</option>
                    </select>
                    <select id="card_type" class="tracking_list1">
                    	<option  value="">选择加油卡类型</option>
                    	<option  value="1">中石化</option>
                    	<option  value="2">中石油</option>
                    </select>
                    <input type="text" class="suoDian" id="card_num"  placeholder="请输入加油卡卡号" value="">
                    <input type="text" class="suoDian" id="user_id" placeholder="请输入充值用户ID" value="">
                    <input type="text" class="suoDian" id="user_name" placeholder="充值用户" value="">
                </div>
                <div id="search2" style="margin-top:10px;">
                    <input readonly type="text" id="start_time" name="start_time" placeholder="订单开始时间"/>
                    <em></em>
                    <input readonly type="text" id="end_time" name="end_time" placeholder="订单结束时间"/>
                    <input type="button" onclick="searchList();" id="search" value="搜索" class="suoSou">
                </div>

            </div>
        </form>
		<div class="listBox" id="listBox">
			<div class="yuList">
			</div>
		</div>
		
		<!--退款付费提问订单弹出窗口-->
        <div class="tanShang question_order_refund" style="display:none">
            <h3>加油卡付费订单退款</h3>
            <ul class="daiJingW">
                <li class="convert_info">
                    <span>商户订单号：</span>
                    <em id="refund_order_id"></em>
                </li>
                <li class="convert_info">
                    <span>支付订单号：</span>
                    <em id="refund_pay_id"></em>
                </li>
                <li class="convert_info">
                    <span>支付方式：</span>
                    <em id="refund_pay_type"></em>
                </li>
                <li class="convert_info">
                    <span>订单金额：</span>
                    <em id="refund_order_amount"></em>
                </li>
                <li class="clearfix tipmsg"></li>
                <li class="clearfix">
                    <input type="hidden" name="id" id="id">
                    <input type="button" value="确定" class="queding" id="qd_question_order_refund"/>
                    <input type="button" value="取消" class="quxiao"/>
                </li>
            </ul>
        </div>
		<div class="clear"></div>
	</div>
</div>

<script>
var status = 2;
getData(1);

function getData(page,params){
	if(!params){
		params = {};
	}
	params.p = page;
	params.status = status;
	$('.yuList').html('')
	$.post('/oilPayOrder/getOrderList',params, function(data){
		$('.yuList').html(data);
	});
}
function getList(s){
	status = s;
	getData(1);
}


function get_page(page){
	getData(page);
}

function searchList(){
	var data = {
		'order_sn' : $('#order_sn').val(),
		'juhe_order_sn' : $('#juhe_order_sn').val(),
		'pay_code' : $('#pay_code').val(),
		'card_type' : $('#card_type').val(),
		'card_num' : $('#card_num').val(),
		'user_id' : $('#user_id').val(),
		'user_name' : $('#user_name').val(),
		'start_time' : $('#start_time').val(),
		'end_time' : $('#end_time').val()
	};
	
	getData(1, data);
}

$("#start_time").ymdateplugin({
	showTimePanel: true,
	changeMonth: true,
	changeYear: true
});

$("#end_time").ymdateplugin({
	showTimePanel: true,
	changeMonth: true,
	changeYear: true
});


function oilpay_order_refund(id) {
    $.post('/OilPayOrder/getOrderInfoJson', {'id': id}, function (data) {
        $("#refund_order_id").html(data.order_sn);
        $("#refund_pay_id").html(data.pay_sn);
        $("#refund_pay_type").html(data.pay_type);
        $("#refund_order_amount").html(data.order_amount);
        $('#id').val(id);
        var str = '确定加油充值订单 <b style="color:red">退款</b> 吗？';
        $('.tipmsg').html(str);
        $('.question_order_refund').show();
    }, 'json');
}

$('#qd_question_order_refund').click(function () {
	var id = $('#id').val();
	$.post('/OilPayOrder/oilPayOrderRefund', {'id': id}, function (data) {
        if (data.code == 200) {
            btn_alert(data.msg);
            setTimeout(function () {
                if (data.data.length == 0) {
                    window.location.reload();
                } else {
                    window.open(data.data);
                    window.location.reload();
                }
            }, 300);
        } else {
            $(".loading").fadeOut();
            shibai_alert(data.msg);
        }
    },'json');
});





</script>
<include file="Public/foot" />